#
# import requests
#
# # 如何请求文件上传的接口
# url = "http://182.92.68.170:8086/api/v3"+"/mailSettings/SetMailSettingOrEntryCodeFileUpload?entryCode=0001&content=c测试测试测试测试测试&type=0"
#
# # 上传的文件参数
# files = {
#     "files": ("./test1.txt", open("test1.txt", "rb"), "images/git")
# }
# data = {
# }
# # 发送请求
# response = requests.post(url=url, files=files, data=data)
# # 打印结果
# print(response.json())
# import winsound
# winsound.Beep(400, 900)


# import asyncio
# import time
# now = lambda: time.time()
# async def do_some_work(x):
#     print('Waiting: ', x)
#     await asyncio.sleep(x)
#     return 'Done after {}s'.format(x)
# start = now()
# coroutine = do_some_work(2)
# loop = asyncio.get_event_loop()
# task = asyncio.ensure_future(coroutine)
# loop.run_until_complete(task)
#
# print('Task ret: ', task.result())
# print('TIME: ', now() - start)
# # 运行结果
# # Waiting:  2
# # Task ret:  Done after 2s
# # TIME:  2.0012385845184326


# from threading import Thread
# from time import sleep
#
# def Ass(f):
#     def wrapper(*args, **kwargs):
#         thr = Thread(target=f, args=args, kwargs=kwargs)
#         thr.start()
#
#     return wrapper
#
# @Ass
# def A():
#     sleep(10)
#     print("函数A睡了十秒钟。。。。。。")
#     print("a function")
#
#
# def B():
#     print("b function")
#
#
# A()
# B()


'''自定义异常处理'''
# import traceback
#
#
# def customExcept(method, exception, exceptMethod,limit):
#     index = 0
#     while True:
#         try:
#             method(True)
#             break
#         except exception:
#             print(index)
#             if index > limit:
#                 traceback.print_exc()  # 打印异常
#                 break
#             if exceptMethod is not None:
#                 exceptMethod(True)
#             index = index + 1
#             continue
#     pass
# s = 1
# h = 2
import ctypes
import inspect
import threading
#
# def ss(driver):
#     while True:
#         btn = driver.find_element(By.CLASS_NAME,"s_btn")
#         btn.click()
# # customExcept(method= (lambda sw : s/h),exception = Exception,exceptMethod = None,limit=3)
# from selenium import webdriver
# from selenium.webdriver.common.by import By
#
# driver = webdriver.Chrome()
# driver.get("http://www.baidu.com")
# threading.Thread(target=ss,args=(driver,)).start()
# #
# workPage = "window.open('https://www.sogou.com/')"
# driver.execute_script(workPage)
# while True:
#     driver.refresh()
import time
# from enum import Enum
#
# from PyNewVersion.AppWindow import CustomThread, stop_thread
#
#
# class CustomEnum1(Enum):
#     global orderCount
#
# class TT:
#     def __init__(self):
#         CustomEnum1.orderCount = 0
#
# class TH:
#     def start(self):
#         while True:
#             CustomEnum1.orderCount = CustomEnum1.orderCount + 1
#             time.sleep(2)
#
# TT()
# t = TH()
# startThread = CustomThread(t.start)
# startThread.start()
# while True:
#     print(CustomEnum1.orderCount)
# timestring = '00:01:08'
# timeS = time.strptime(timestring, '%H:%M:%S')
# print(timeS.tm_min)
# print(timeS.tm_sec)
try:
    s=1/0
except Exception as e:
    print(e.msg)